package com.nlx.notes.module.mapper;

import com.nlx.notes.module.bean.vo.category.CategoriesVO;
import com.nlx.notes.module.entity.Categories;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author nlx
 * @since 2024-12-15
 */
public interface CategoriesMapper extends BaseMapper<Categories> {

    @Select(" select parent_id from categories where id = #{categoryId}")
    Long findParentIdByCategoryId(Long categoryId);

    List<CategoriesVO> findCategoryByCategoryIds(Set<Long> categoryIds);

    List<Categories> findListByUser(@Param("categoryType") String categoryType, @Param("userId") Long userId);
}
